package com.tang.resume.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tang.resume.entity.RResume;
import com.tang.resume.service.IRResumeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tzf
 * @since 2021-12-07
 */
@RestController
@RequestMapping("/resume")
@RequiredArgsConstructor
public class ResumeController {
    private final IRResumeService resumeService;

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/openstate/{userId}")
    public Integer findByUserId(@PathVariable("userId") String userId){
//       return resumeService.getOne(new LambdaQueryWrapper<RResume>().eq(RResume::getUserid,userId)).getIsopenresume();
        resumeService.getOne(new LambdaQueryWrapper<RResume>().eq(RResume::getUserid,userId)).getIsopenresume();
        return port;
    }
}
